|
|
|
|
|
|
|
objDG.BottomTitle = "Months"
'
Case 2 ' sales by customer
End Select
'
objDG.ShowGraph
'
End Sub |
|
|
|
|
|
|
|
|
The only real difference here is the new SQL statement and the settings for the titles, labels, and legends. Save and run this code. Check your resultant graph with the one shown in Figure 11.15. |
|
|
|
|
|
|
|
|
Figure 11.15.
Displaying the Sales by Month line graph. |
|
|
|
|
|
|
|
|
Finally, add the Sales by Company bar graph to the CompanyMaster project. Here is the SQL statement you need to produce a dataset that contains the year-to-date sales figures by company: |
|
|
|
|
|
|
|
|
SELECT CompanyName, SUM(Amount) AS SalesTotal
FROM SalesData
WHERE CompanyName<>'Budget'
GROUP BY CompanyName; |
|
|
|
|
|
|
|
|
Now modify the mnuGraphsItem_Click event to match the code in Listing 11.31. |
|
|
|
|
|
|
|
|
Listing 11.31. Modifying the mnuGraphsItem_click event. |
|
|
|
|
|
|
|
|
Private Sub mnuGraphsItem_Click(Index As Integer)
'
' handle graph menu requests |
|
|
|
|
|